﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ZF.BLL
{

    /// <summary>
    /// 用户接口
    /// </summary>
    public interface IMember
    {
        #region
        /// <summary>
        ///  用户ID
        /// </summary>
        int MemberId { get; }
 
        /// <summary>
        /// 帐号
        /// </summary>
        string Account { get; }
        string Password { get; }
        string FullName { get; }
        string QQ { get; }
        string Phone { get;  }
        /// <summary>
        /// 邮箱
        /// </summary>
        string EMail { get; }
      
        /// <summary>
        /// 用户状态
        /// </summary>
        UserStatus Status { get; }

        string Address { get; }
        string Zipcode { get; }
        string Tel { get; }
        /// <summary>
        /// 登录ip
        /// </summary>
        string LoginIp { get; }
        /// <summary>
        /// 会员类型
        /// </summary>
        UserType UserType { get;  }
        int Integral { get; set; }
        /// <summary>
        /// 是否为专家
        /// </summary>
        bool IsExpert { get;  }
        /// <summary>
        /// 是否为中价
        /// </summary>
        bool IsMedium { get; }
        #endregion
    }
    /// <summary>
    /// 用户基类
    /// </summary>
    public abstract class MemberBase: IMember
    {
        #region
 
        /// <summary>
        ///  用户ID
        /// </summary>
        public int MemberId { get; set; }
        /// <summary>
        /// 帐号
        /// </summary>
        public virtual string Account { get; set; }
        public virtual string Password { get; set; }
      
        /// <summary>
        /// 邮箱
        /// </summary>
        public virtual string EMail { get; set; }

        /// <summary>
        /// 用户状态
        /// </summary>
        public virtual UserStatus Status { get; set; }

        /// <summary>
        /// 登录ip
        /// </summary>
        public string LoginIp { get; set; }
        /// <summary>
        /// 当前用户客户端信息
        /// </summary>

        public string Address { get; set; }
        public string Zipcode { get; set; }
        public string Tel { get; set; }
        public int Integral { get; set; }
        public string FullName { get; set; }
        public string QQ { get; set; }
        public string Phone { get; set; }
        public abstract UserType UserType { get; }
        public bool IsExpert { get; set; }
        public bool IsMedium { get; set; }
        #endregion
    }
    public class  GeneralMember:MemberBase,IMember
    {

        public override UserType UserType { get { return UserType.Member; } }
    }
    public class ManageMember : MemberBase, IMember
    {

        public override UserType UserType { get { return UserType.Admin; } }
        public virtual List<string> RightModules { get; set; }
    }
    
}
